package com.ktjy.sample.entity;

public class Baby {
    //一个宝贝出生时 必须确认母亲和性别
    public Baby(Woman mother, String sex) {
        this.mother = mother;
        this.sex = sex;
    }

    public Baby() {
    }

    //姓名可以随时修改
    private String name;
    private Woman mother;
    private String sex;

    public String getName() {
        return name;
    }

    public Woman getMother() {
        return mother;
    }

    public String getSex() {
        return sex;
    }

    public void setName(String name) {
        this.name = name;
    }
    public void introduce(){
        System.out.println("我是"+sex+"宝宝，我的妈妈是"+mother.getName());
        if (name != null){
            System.out.println("我的名字叫"+name);
        }else {
            System.out.println("我还没有名字");
        }
    }
}
